export function getAllChildren(ary){
    if(ary&&ary.length>0){
        return ary.reduce((prev,cur)=>{
            const {list}=cur
            return [...prev,...list]
        },[])
    }
}

export function getDynamicRouteChildren(routes,childList){
    //找到home所在路由
    for(let i=0;i<routes.length;i++){
        let route=routes[i]
        if(route.path==="/home"){
            let filterAry=route.children.filter(item=>{
               if(childList.map(item=>item.url).includes(item.path)){
                 return true
               }
            })
            return filterAry
        }
    }
}